<template>
	<div class="actives">
		<div class="fixed">
			<div class="title flex">
				<div class="title_left">
					<img @click="back" src="../assets/image/return.png" />
				</div>
				<div class="add">
					参与店铺
				</div>
				<div>
				</div>
			</div>

		</div>
		<div class="lists" v-if="tableData!=''">

			<div class="list flex" v-for="(item,index) in tableData" :key="index" @click="skiptoshop_detail(item.link_id)">
	
					<div class="left flex">
						<img src="../assets/image/shop.png"/>
						<div>{{item.store_name}}</div>
						
					</div>
					<div class="right flex" >
						<div>{{item.coupons_name}}</div>

					</div>
				</div>
				

			</div>
			<div class="none flex" v-else>
				空空如也哦~
			</div>
		</div>

	</div>

</template>

<script>
	export default {
		data() {
			return {
				isActive: 0,
				show: -1,
				activeIndex: -1,
				active_id:this.$route.query.active_id,//活动id
				tableData:"",
			}
		},
		//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
		created: function() {

		},
		methods: {
			back() {
				this.$router.go(-1)
			},
			showop(index) {
				let that = this;
				if(that.show == index) {
					that.show = -1; //在这里就将它赋值为-1  由于：-1 !=  index 所以其他内容隐藏 ，被点击的则打开
				} else {
					that.show = index; //这里是把index赋值给isShow，isShow=index则显示
				}

			},
			//查看详情
			creat_c() {
				this.$router.push({
					path: '/Create_coupons'
				});
			},
			skiptoshop_detail(id){
				this.$router.push({
					path: '/quan_detail',
					query:{
						link_id:id
					}
				});
			},
			showtost() {
				$(".mask").css('display', 'block');

			},
			yincang() {
				$(".mask").css('display', 'none');
			},
			 list(){
           	var that=this;
      var qs = require('qs');
			that.$http.post(this.baseURL+"/index.php/waveguest/coupon/vender_list", qs.stringify({
						"active_id": that.active_id,
						"key":localStorage.getItem("key")
				})).then(response => {
					
					that.tableData=response.data.data
					console.log(that.tableData)
					})
					.catch(error => {

					});
    
           }
		},
	
		mounted() {
this.list()
		},
	}
</script>

<style>

</style>
<style scoped="scoped">
	.active {
		color: #007AFF;
	}
	.title_left {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.title_left>img {
		width: 0.67391rem;
		height: 0.67391rem;
	}
	
	.lists {
	
		-webkit-overflow-scrolling : touch;
		position: fixed;
		bottom: 0;
		top: 1.9rem;
		background: #F5F6FA;
		width: 100%;
		padding: 1rem 0;
		overflow-y: scroll;
		
	}
	.list {
		/*border: 1px solid white;*/
		margin-bottom: 0.5rem;
		margin-left: 0.5rem;
		margin-right: 0.5rem;
		padding-right: 1rem;
		padding-left: 1rem;
		background: url(../assets/image/couponmaxh.png) no-repeat;
		background-size: 100%;
		border-radius: 10px;
		height: 3rem;
		justify-content: space-between;
		align-items: center;
	}
	
	.fixed {
		position: fixed;
		top: 0;
		background: white;
		width: 100%;
		max-width: 640px;
		z-index: 99;
	}
	
	.title {
		width: 90%;
		padding: 0 5% 0 5%;
		height: 2rem;
		font-size: 0.7193rem;
		background: white;
		align-items: center;
	}
	
	.title div {
		width: calc(100%/3);
		align-items: center;
	}
	
	.title>div:nth-child(2) {
		text-align: center;
	}
	
	.add>img {
		width: 1rem;
		height: 1rem;
	}
	
	.left {
		align-items: center;
	}
	
	.list>.left>img {
		width: 0.47826rem;
		height: 0.47826rem;
		padding-right: 0.2rem;
	}
	
	.list>.left>div{
		font-size: 0.60869rem;
		color: #868E91;
	}
	.list>.right>div{
		color: #3E474E1;
		font-size: 1.10869rem;
		font-weight: 400;
	}
	.none{
		position: fixed;
		width: 100%;
		height: 100%;
		background: #F5F6FA;
		justify-content: center;
		align-items: center;
		font-size: 0.5217rem;
	}
	
	
	
</style>